<?php
mysql_connect("127.0.0.1","root","");
mysql_select_db("test");
$res=mysql_query("select max(id) from msg;");
$v=mysql_fetch_row($res);
$id=$v[0]+1;
$msg=$_GET['msg'];
echo $msg;
mysql_query("insert into msg values($id,'$msg');");
?>